package com.ghck.shop;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
import org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration;
import org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration;
import org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration;
import org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration;
import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import com.ghck.shop.config.ResourceConfig;
import com.ghck.shop.config.UserProfile;

/** 
 * 
 * @author chenxuan
 *
 */

@Configuration
@Import({
	 DispatcherServletAutoConfiguration.class
	,EmbeddedServletContainerAutoConfiguration.class
	,ErrorMvcAutoConfiguration.class
	,HttpEncodingAutoConfiguration.class
	,HttpMessageConvertersAutoConfiguration.class
	,MultipartAutoConfiguration.class
	,ServerPropertiesAutoConfiguration.class
	,PropertyPlaceholderAutoConfiguration.class
	,WebMvcAutoConfiguration.class
	
	,ResourceConfig.class
})
@ComponentScan
public class ShopApplication {
	
	public static void main(String args[]){
		if(System.getProperty("spring.profiles.active")==null){
			System.setProperty("spring.profiles.active", UserProfile.INTG);
		}
		SpringApplication.run(ShopApplication.class, args);
	}
}